this._inDrag = false;
},
- // show:
- //
- // Animates the overview visible and grabs mouse and keyboard input
- show: function() {
- if (this.isDummy)
- return;
- if (this._shown)
- return;
- this._shown = true;
-
- if (!this._syncGrab())
- return;
-
- Main.layoutManager.showOverview();
- this._animateVisible();
- },
-
focusSearch: function() {
this.show();
this._searchEntry.grab_key_focus();
});
},
+ // Checks if the Activities button is currently sensitive to
+ // clicks. The first call to this function within the
+ // OVERVIEW_ACTIVATION_TIMEOUT time of the hot corner being
+ // triggered will return false. This avoids opening and closing
+ // the overview if the user both triggered the hot corner and
+ // clicked the Activities button.
+ shouldToggleByCornerOrButton: function() {
+ if (this.animationInProgress)
+ return false;
+ if (this._inDrag)
+ return false;
+ if (this._activationTime == 0 || Date.now() / 1000 - this._activationTime > OVERVIEW_ACTIVATION_TIMEOUT)
+ return true;
+ return false;
+ },
+
+ _syncGrab: function() {
+ // We delay grab changes during animation so that when removing the
+ // overview we don't have a problem with the release of a press/release
+ // going to an application.
+ if (this.animationInProgress)
+ return true;
+
+ if (this._shown) {
+ let shouldBeModal = !this._inXdndDrag;
+ if (shouldBeModal) {
+ if (!this._modal) {
+ if (Main.pushModal(this._overview,
+ { keybindingMode: Shell.KeyBindingMode.OVERVIEW })) {
+ this._modal = true;
+ } else {
+ this.hide();
+ return false;
+ }
+ }
+ }
+ } else {
+ if (this._modal) {
+ Main.popModal(this._overview);
+ this._modal = false;
+ }
+ }
+ return true;
+ },
+
+ // show:
+ //
+ // Animates the overview visible and grabs mouse and keyboard input
+ show: function() {
+ if (this.isDummy)
+ return;
+ if (this._shown)
+ return;
+ this._shown = true;
+
+ if (!this._syncGrab())
+ return;
+
+ Main.layoutManager.showOverview();
+ this._animateVisible();
+ },
+
+
_animateVisible: function() {
if (this.visible || this.animationInProgress)
return;
this.emit('showing');
},
+ _showDone: function() {
+ this.animationInProgress = false;
+ this._desktopFade.hide();
+ this._coverPane.hide();
+
+ this.emit('shown');
+ // Handle any calls to hide* while we were showing
+ if (!this._shown)
+ this._animateNotVisible();
+
+ this._syncGrab();
+ global.sync_pointer();
+ },
+
// hide:
//
// Reverses the effect of show()
this._syncGrab();
},
- toggle: function() {
- if (this.isDummy)
- return;
-
- if (this.visible)
- this.hide();
- else
- this.show();
- },
-
- // Checks if the Activities button is currently sensitive to
- // clicks. The first call to this function within the
- // OVERVIEW_ACTIVATION_TIMEOUT time of the hot corner being
- // triggered will return false. This avoids opening and closing
- // the overview if the user both triggered the hot corner and
- // clicked the Activities button.
- shouldToggleByCornerOrButton: function() {
- if (this.animationInProgress)
- return false;
- if (this._inDrag)
- return false;
- if (this._activationTime == 0 || Date.now() / 1000 - this._activationTime > OVERVIEW_ACTIVATION_TIMEOUT)
- return true;
- return false;
- },
-
- _syncGrab: function() {
- // We delay grab changes during animation so that when removing the
- // overview we don't have a problem with the release of a press/release
- // going to an application.
- if (this.animationInProgress)
- return true;
-
- if (this._shown) {
- let shouldBeModal = !this._inXdndDrag;
- if (shouldBeModal) {
- if (!this._modal) {
- if (Main.pushModal(this._overview,
- { keybindingMode: Shell.KeyBindingMode.OVERVIEW })) {
- this._modal = true;
- } else {
- this.hide();
- return false;
- }
- }
- }
- } else {
- if (this._modal) {
- Main.popModal(this._overview);
- this._modal = false;
- }
- }
- return true;
- },
_animateNotVisible: function() {
if (!this.visible || this.animationInProgress)
this.emit('hiding');
},
- _showDone: function() {
- this.animationInProgress = false;
- this._desktopFade.hide();
- this._coverPane.hide();
-
- this.emit('shown');
- // Handle any calls to hide* while we were showing
- if (!this._shown)
- this._animateNotVisible();
-
- this._syncGrab();
- global.sync_pointer();
- },
-
_hideDone: function() {
// Re-enable unredirection
Meta.enable_unredirect_for_screen(global.screen);
this._fakePointerEvent();
this._needsFakePointerEvent = false;
}
+ },
+
+ toggle: function() {
+ if (this.isDummy)
+ return;
+
+ if (this.visible)
+ this.hide();
+ else
+ this.show();
}
});
Signals.addSignalMethods(Overview.prototype);